@extends('app')

@section('content')
<link href="{{ asset('/css/spinners.css') }}" rel="stylesheet">

<div id="grid" class="grid" style="position: fixed;z-index: 1000;left:50%;display: none;">
    <div class="cell">
        <div class="card">
            <span class="throbber-loader">Loading…</span>
        </div>
    </div>
</div>

<ul class="nav nav-tabs">
    <li class="active"><a href="{{ url('/admin/enterprise/users')}}">信息列表</a></li>
    <li><a href="{{ url('/admin/enterprise/users/create') }}">信息添加</a></li>
</ul>

<div class="panel panel-default mt20">
    <div class="table-responsive panel-body">
        <table class="table table-hover">
          <thead>
            <tr>
              <th>企业名称</th>
              <th>用户昵称</th>
              <th>真实姓名</th>
              <th>邮箱</th>
              <th>手机</th>
              <th>性别</th>
              <th>状态</th>
              <th>创建时间</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
          @foreach($userlist as $res)
            <tr id="news_{{ $res->id }}">
              <td>{{ $res->companyname}}</td>
              <td>{{ $res->name }} </a></td>
              <td>{{ $res->real_name }}</td>
              <td>{{ $res->email }}</td>
              <td>{{ $res->phone}}</td>
              <td>{{ $res->sex?'男':'女' }}</td>
              <td id="disabled">
                    @if($res->is_active == 1)
                    <span class="glyphicon glyphicon-ok-circle  green-remove"
                        onclick="changeUserStatus('/admin/enterprise/users/status','{{ $res->id }}', '{{ $res->is_active }}', '{{ csrf_token() }}')"></span>
                    @else
                    <span class="glyphicon glyphicon-remove-circle red-ok"
                          onclick="changeUserStatus('/admin/enterprise/users/status','{{ $res->id }}', '{{ $res->is_active }}', '{{ csrf_token() }}')"></span>
                    @endif
                </td>
              <td>{{ $res->created_at}}</td>
              <td>
                <a href="{{ url('/admin/enterprise/users/'.$res->id.'/edit') }}"><i class="glyphicon glyphicon-edit"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
              </td>
            </tr>
          @endforeach
          </tbody>
        </table>
    </div>
</div>
<div>{!! $userlist->render() !!} </div>
@endsection
